public class Test {
    public static void Drawmap(Shape shape){//这个方法的存在是为了更快捷的调用不同的子类，否则要一个一个实例化然后访问成员方法。现在只需要调用这一个方法
        shape.draw();
    }
    public static void main(String[] args) {
        Drawmap(new Flower());
        Drawmap(new Rect());
    }
}
class Shape{
    public void draw(){
        System.out.println("画图形！！");
    }
}
class Rect extends Shape{
    @Override
    public void draw() {
        System.out.println("画矩形！");
    }
}
class Cycle extends Shape{
    @Override
    public void draw() {
        System.out.println("画圆形！");
    }
}
class Flower extends Shape{
    @Override
    public void draw() {
        System.out.println("🌷");
    }
}


